<template>
  <div class="goodsList">
    <div class="goods-item" v-for="(item, index) in recommendInfo" :key="index">
      <v-image :src="item.image" :lazy-load="true"></v-image>
      <div>
        <p class="desc">{{ item.title }}</p>
        <div class="priceAndsc">
          <span class="price">￥{{ item.price }}</span>
          <icon name="star-o" /><span>{{ item.cfav }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { Icon, Image as vImage } from "vant";
export default {
  name: "recommend",
  components: {
    vImage,
    Icon
  },
  props: {
    recommendInfo: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {};
  },
  methods: {}
  // mounted() {
  //   console.log(this.recommendInfo);
  // }
};
</script>

<style scoped lang='scss'>
.goodsList {
  box-sizing: border-box;
  padding: 0 4px;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  .goods-item {
    width: 175px;
    text-align: center;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    .desc {
      font-size: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      margin-bottom: 3px;
    }
    .priceAndsc {
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      .price {
        color: #ff5777;
        font-size: 12px;
        margin-right: 10px;
      }
    }
  }
}
</style>
